package DAO;

import Frames.MainFrame;
import Interfaces.IFindStore_Dao;
import Models.FindStore;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;

public class FindStore_Dao implements IFindStore_Dao {

    @Override
    public FindStore findStore(String StoreName) throws IllegalArgumentException {

        Connection conn = null;
        ResultSet rs = null;
        PreparedStatement pst = null;
        conn = javaconnect2.connectDB();
        String query = "SELECT * FROM stores WHERE storename=? ";
        try {
            pst = conn.prepareStatement(query);
            pst.setString(1, StoreName);
            rs = pst.executeQuery();
            pst.close();
            conn.close();
        } catch (SQLException e) {
            throw new IllegalArgumentException("Error in Login_Dao");
        }
        return null;
    }
}
